<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        .parent{
            width:400px;
            height:400px;
            background-color: red;
            position: relative;
        }
        .child{
            position: absolute;
            width:100px;
            height:100px;
            background-color: pink;
            top: 50%;left: 50%;
            margin-top: -50px;
            margin-left: -50px;
        }
    </style>
</head>
<body>
<div class="parent">
    <div class="child">

    </div>
</div>
</body>
</html>